﻿@model IEnumerable<ToWaDBFirst.Models.MessageWrapper>

@{
    ViewBag.Title = "Inbox";
}
<script type="text/javascript">
    $(document).ready(function () {
        $("#myTable").tablesorter();
    }
); 
</script>
<h2>Inbox</h2>

<table id="myTable">
    <thead>
    <tr>
        <th>
            Title
        </th>
        <th>
            From
        </th>
        <th>
            Received
        </th>
        <th>
            Read
        </th>
        <th>
        </th>
    </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(item.title, "Details", new {id = item.messageId})
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.fromUser)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.posted)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.read)
        </td>
        <td>
            @Html.ActionLink("Delete", "Delete", new { id = item.messageId })
        </td>
    </tr>
}
    </tbody>

</table>
